package com.one.efaimaly.order.model;

import com.one.common.common.order.MaterialItem;
import com.one.common.model.http.base.BaseResponse;
import com.one.efaimaly.order.model.item.OrderDetailItem;

import java.util.List;
import java.util.Map;

import io.reactivex.Observable;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.POST;

/**
 * author ：zhulunjun
 * email  ：zhulunjun@qq.com
 * date   ：2018/8/8 上午12:04
 * description ：
 **/
public interface OrderApi {

    /**
     * 订单详情
     */
    @FormUrlEncoded
    @POST("/maintailInterfaces/v1.0/getMaintailOrderDetail")
    Observable<BaseResponse<OrderDetailItem>> getOrderDetail(@FieldMap Map<String, String> params);

    /**
     * 添加材料
     */
    @FormUrlEncoded
    @POST("/maintailInterfaces/v1.0/insertMaintailOrderMaterials")
    Observable<BaseResponse<String>> addMaterial(@FieldMap Map<String, String> params);

    /**
     * 获取材料列表
     */
    @FormUrlEncoded
    @POST("/maintailInterfaces/v1.0/getMaintailMaterials")
    Observable<BaseResponse<List<MaterialItem>>> getMaterial(@FieldMap Map<String, String> params);

    /**
     * 取消订单
     */
    @FormUrlEncoded
    @POST("/maintailInterfaces/v1.0/refuseWorkerOrder")
    Observable<BaseResponse<String>> cancel(@FieldMap Map<String, String> params);

    /**
     * 上传维修图片
     */
    @FormUrlEncoded
    @POST("/maintailInterfaces/v1.0/updateMaintailOrder")
    Observable<BaseResponse<String>> uploadImg(@FieldMap Map<String, String> params);

    /**
     * 添加备注
     */
    @FormUrlEncoded
    @POST("/maintailInterfaces/v1.0/updateMaintailOrder")
    Observable<BaseResponse<String>> addRemark(@FieldMap Map<String, String> params);
}
